Both
Python and R have vast software ecosystems and communities, so either language
is suitable for almost any data science task. That said, there are some areas
in which one is stronger than the other.
·
The majority of deep
learning research is done in Python, so tools such as Keras and
PyTorch have "Python-first" development. You can learn about these
topics in Introduction to Deep Learning in Keras and Introduction to Deep Learning in PyTorch.
·
Another area where
Python has an edge over R is in deploying models to other pieces of
software. Python is a general purpose programming language, so if you write
an application in Python, the process of including your Python-based model is
seamless. We cover deploying models in Designing Machine Learning Workflows in Python and Building Data Engineering Pipelines in Python.
·
Python is often praised
for being a general-purpose language with an easy-to-understand syntax
Where R Excels
·
A lot of statistical
modeling research is conducted in R, so there's a wider variety of
model types to choose from. If you regularly have questions about the best way
to model data, R is the better option. DataCamp has a large selection of courses on statistics with R.
·
The other big trick up
R's sleeve is easy dashboard creation using Shiny. This enables people without
much technical experience to create and publish dashboards to
share with their colleagues. Python does have Dash as an alternative, but it’s
not as mature. You can learn about Shiny in our course on Building Web Applications with Shiny in R.
·
R's functionality was
developed with statisticians in mind, thereby giving it field-specific
advantages such as great features for data visualization.
This list is far from exhaustive and experts endlessly debate which tasks can be done better in one language or another. Further, Python programmers and R programmers tend to borrow good ideas from each other. For example, Python's plotnine data visualization package was inspired by R's ggplot2 package, and R's rvest web scraping package was inspired by Python's BeautifulSoup package. So eventually, the best ideas from either language find their way into the other making both languages similarly useful & valuable.
https://www.quora.com/What-are-the-major-differences-between-Python-and-R-for-data-scienceDear